package com.coin.dao.account;

import com.coin.dao.model.Account;
import com.coin.dao.model.AccountExample;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface AccountMapper {
    long countByExample(AccountExample example);

    int deleteByExample(AccountExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Account record);

    int insertMainTable(Account record);

    int insertSelective(Account record);

    List<Account> selectByExample(AccountExample example);

    Account selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Account record, @Param("example") AccountExample example);

    int updateByExample(@Param("record") Account record, @Param("example") AccountExample example);

    int updateByPrimaryKeySelective(Account record);

    int updateByPrimaryKey(Account record);

    int subtractBalance(@Param("amount") BigDecimal amount, @Param("memberId") Long memberId, @Param("memberType") int memberType, @Param("accountType") int accountType,@Param("tableId")String tableId);

    int subtractBalanceWithoutZeroLimit(@Param("amount") BigDecimal amount, @Param("memberId") Long memberId, @Param("memberType") int memberType, @Param("accountType") int accountType,@Param("tableId")String tableId);

    int addBalance(@Param("amount") BigDecimal amount, @Param("memberId") Long memberId, @Param("memberType") int memberType, @Param("accountType") int accountType,@Param("tableId")String tableId);
}